home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / Newton Platform Info / Newton 2.0 Sample Code / Routing / CustomRoute-2 / Install&RemoveScripts.f < prev    next >
Encoding:
Text File  |  1995-11-21  |  1.2 KB  |  37 lines  |  [TEXT/NTP1]

  1. /*
  2. **      Newton Developer Technical Support Sample Code
  3. **
  4. **      Custom Route, a Newton 2.0 routing example
  5. **
  6. **      by J. Christopher Bell, Newton Developer Technical Support
  7. **
  8. **      Copyright © 1994-5 by Apple Computer, Inc.  All rights reserved.
  9. **
  10. **      You may incorporate this sample code into your applications without
  11. **      restriction.  This sample code has been provided "AS IS" and the
  12. **      responsibility for its operation is 100% yours.  You are not
  13. **      permitted to modify and redistribute the source as "DTS Sample Code."
  14. **      If you are going to re-distribute the source, we require that you
  15. **      make it clear in the source that the code was descended from
  16. **      Apple-provided sample code, but that you've made changes.
  17. */
  18.  
  19.  
  20. InstallScript := func(partFrame)
  21.     begin
  22.         local myApp := partFrame.theForm;
  23.         
  24.         RegisterViewDef(myApp.MyFormats.viewFormat, kMyMainDataDefSym);
  25.         RegisterViewDef(myApp.MyFormats.myFrameFormat, kMyMainDataDefSym);
  26.     end;
  27.  
  28.  
  29. // run when application and/or card with app removed
  30. // cleanup routing stuff
  31. RemoveScript := func(partFrame)
  32.     begin
  33.         UnregisterViewDef(kMyMainViewDefSym, kMyMainDataDefSym);
  34.         UnregisterViewDef(kMyFrameViewDefSym, kMyMainDataDefSym);
  35.     end;
  36.  
  37.